<?php

require 'Response.php';
require 'DB.php';

//$str_search='';
//if(!empty($_REQUEST['id'])){
//    $type_id=$_REQUEST['id'];
//    if ($type_id==-1){
//        $str_search=" WHERE type_id=(SELECT id FROM `news_type` WHERE state=1 LIMIT 1)";
//    }else{
//        $str_search=" WHERE type_id=$type_id";
//    }
//
//}

//$type_id=$_REQUEST['id'];

$pdo=DB::getInstance()->connect();


$stmt = $pdo->query("SELECT * FROM `infors`");
//$stmt = $pdo->query(); //返回一个PDOStatement对象

$data = $stmt->fetchAll();//获得所有
//var_dump($data);
Response::json('200','成功',$data);

